package team.seekers.hula.island.postComment.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import team.seekers.hula.common.entity.PageResult;
import team.seekers.hula.island.postComment.service.IslandPostCommentManageService;
import team.seekers.hula.auth.service.MindUtils;
import team.seekers.hula.island.postComment.entity.dto.PostCommentQueryDTO;
import team.seekers.hula.island.postComment.entity.dto.PostCommentUpdateDTO;
import team.seekers.hula.island.postComment.entity.vo.PostCommentManagePageVO;

import team.seekers.hula.common.annotation.ApiResponseBody;

/**
 * @author ekin
 * @Description GOOD
 * @mood happy
 */
@Controller
@ApiResponseBody
@RequestMapping("/manage/post/comment")
public class PostCommentManageController {

    @Autowired
    private IslandPostCommentManageService islandPostCommentService;

    /**
     *
     * 浪屿评论管理
     */
    @GetMapping("/page")
    public PageResult<PostCommentManagePageVO> pageComment(PostCommentQueryDTO postCommentQueryDTO) {
        postCommentQueryDTO.setUserId(MindUtils.getUserId());
        return islandPostCommentService.pageComment(postCommentQueryDTO);
    }

    @PostMapping("/update")
    public void update(@RequestBody PostCommentUpdateDTO updateDTO){
        islandPostCommentService.updatePostComment(updateDTO);
    }

}
